#INT_TIMER3
void   tmr_3_isr   (void)
{
    static int8 ms_100, refresh_count;
    static int8 temp_t;
    set_timer3(-62500); //interrupt on every 50 ms.
    clear_interrupt(INT_TIMER3);
    //speed divider x2

#if ((2 == __BUILD_TYPE__) && (0 == PROTEUS_SIM))
    i2c_do_refresh = 1; // enable send i2c packet
#endif

    buzz=1;  // buzzer off   // for oscilator fail debug

    if (temp_t >= T3_INT_DIV_M-1) {
        temp_t= 0;
#if ((2 == __BUILD_TYPE__) && (0 == PROTEUS_SIM))
        i2c_do_refresh = 1; // enable send i2c packet
#endif

        if (refresh_count < (REFRESH_TIME-1)) {
            refresh_count++;
        } else {
            refresh_count = 0;
            refresh_data = 1;
        }
        // one second counter
        if (ms_100 < SECONDS_COUNT_T3 -1) {
            ms_100++;
        } else {
            ms_100 = 0;
#if (3 != __BUILD_TYPE__)
            out_parm.seconds++; // count 1 second
#endif
        }
#if (3 != __BUILD_TYPE__)
        if (acc_timer) {
            acc_timer--;
        } else if (tail_off_timer) {
            pw_acc -= tail_off_step;
            tail_off_timer--;
        } else {
            // Deacc tap
            pw_acc_last = pw_acc = 0;
            //tail_off_timer=acc_timer=0
        }
  #ifdef ADC_SYNCH
        if (ad_ok==0) {
            read_adc(adc_start_only);
        }
  #else
        read_adc(adc_start_only);
  #endif
#endif
    } else {
      temp_t ++;
    }
    return;
}
